home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / comp / execfpri.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  999 b   |  43 lines

  1. /*
  2.                              E X E C F P R I . C
  3.  
  4. */
  5.  
  6. #include "iccomp.h"
  7.  
  8. ESTRUC_ *exec_fprintf(type, args)
  9.     E_TYPE_
  10.         type;
  11.     ESTRUC_
  12.         *args;
  13. {
  14.     register int
  15.         ok;
  16.     ESTRUC_
  17.         *e0;
  18.  
  19.     if (args->type < 2)                     /* argcount must be at least 2 */
  20.     {
  21.         semantic(illegal_argcount, funstring[type]);
  22.         return (args);
  23.     }
  24.  
  25.     e0 = codestruc(args, 0);                /* pointer to first arg */
  26.  
  27.     switch (type)
  28.     {
  29.         case f_fprintf:                     /* first arg must be string */
  30.             ok = test_type(e0, e_str);
  31.         break;
  32.  
  33.         default:                            /* 1st arg must be int,   */
  34.             ok = test_type(e0, e_int) &&    /* 2nd arg must be string */
  35.                  test_type(codestruc(args, 1), e_str);
  36.     }
  37.  
  38.     if (ok)
  39.         return (specials(type, args));      /* return specials call */
  40.  
  41.     semantic(type_conflict, funstring[type]); /* type conflict error */
  42.     return (args);
  43. }